﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SurfacePlatform
{
    class Obstacle : Touchable
    {
        private String name;
        private int damage;
        private float velocity;
        private Texture2D texture;

        public String Name
        {
            get { return name; }
            set { name = value; }
        }
        public int Damage
        {
            get { return damage; }
            set { damage = value; }
        }

        public float Velocity
        {
            get { return velocity; }
            set { velocity = value; }
        }
        public Texture2D Texture
        {
            get { return texture; }
            set { texture = value; }
        }


        public void Hit(Player player)
        {
            switch (this.name)
            {
                case "damage":
                    player.Health -= this.damage;
                    break;
                case "slow":
                    player.MaxVelocity -= 1f;
                    break; 
                case "fast":
                    player.MaxVelocity += 0.5f;
                    break;
            }
            this.FlaggedForRemoval = true;
        }


        public Obstacle(String name, int damage, Vector2 position, float radius, Vector2 gravity, Texture2D texture)
        {
            this.name = name;
            this.damage = damage;
            base.Position = position;
            base.Radius = radius;
            base.Gravity = gravity;
            base.LastPosition = Vector2.Zero;
            base.FingerLock = false;
            this.texture = texture;
        }
    }
}
